<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

require 'AliyunClient.class.php';
require 'PingAliyun.php';
require 'BasicConfig.php';

class DescribeDomainRecordInfo extends AliyunClient {

    public function execute($RecordId) {
        $PublicParams["RecordId"] = (string) $RecordId;
        $PublicParams["AccessKeyId"] = $this->accessKeyId;
        $PublicParams["Format"] = self::FORMAT;
        $PublicParams["SignatureMethod"] = self::SIGNATUREMETHOD;
        $PublicParams["SignatureVersion"] = self::SIGNATUREVERSION;
        $PublicParams["SignatureNonce"] = $this->CreateSignatureNonce();
        date_default_timezone_set("UTC");
        $PublicParams["TimeStamp"] = date(self::DATETIMEFORMAT);
        $PublicParams["Version"] = self::VERSION;
        $PublicParams["Action"] = $this->Action;
        $PublicParams["RecordId"] = $RecordId;

        $PublicParams["Signature"] = $this->computeSignature($PublicParams, $this->accessKeySecret);
        $requestUrl = rtrim(self::SERVERURL, "/") . "/?";
        foreach ($PublicParams as $ParamKey => $ParamValue) {
            $requestUrl .= "$ParamKey=" . urlencode($ParamValue) . "&";
        }
        $requestUrl = substr($requestUrl, 0, -1);
        return (string) $requestUrl;
    }

}

$test = new DescribeDomainRecordInfo('OGLktN16TnXLCebV', '8ovNTeDmb4iuqmw5TCsVUJwyR30two', DDRI);
$b = $test->execute("64104993");
echo CurlAliyun($b);
